# Makefile for stdlib32.lib for Borland's (now Inprice ...) MAKE.EXE
# By wbinvd for Visual Assembler
# This is free software
# (add other legal stuff here)

# You can define these equates too. Use them in ASMFLAGS only
# /dTASM        If it's TASM(32). Else, we assume it's MASM (ML.EXE)
# /dUNICODE     If we should create a UNICODE library

# Assembler and options
ASM             = tasm32
ASMFLAGS        = /w2/ml/t /dTASM
!if $d(DEBUG)   # "Make -DDEBUG" to add debugging info
ASMDFLAGS       = /zi
!else
ASMDFLAGS       =
!endif

LIB             = tlib
LIBFLAGS        =

RSPFILE         = stdlib32.rsp  # This file has the name's of all .OBJ files
LIBOBJS32       = cmdline.obj __ntoa.obj ntoa.obj __antob.obj antob.obj\
                strlen.obj strcmp.obj stricmp.obj strcpy.obj strcat.obj\
                strdup.obj\
                mem.obj
STDLIB32        = stdlib32

.asm.obj:
        $(ASM) $(ASMDFLAGS)$(ASMFLAGS) $*.asm

# You need to copy import32.lib to this dir or add its full path
test.exe: test.obj $(STDLIB32).lib
        tlink32 /Tpe/aa/V4.0 /v test,test,test,import32 $(STDLIB32)

# Create the disassembler library and $(DISLIB32).lst file
$(STDLIB32).lib: $(LIBOBJS32)
        @if exist $(STDLIB32).lib       del $(STDLIB32).lib
        @echo $(STDLIB32) $(LIBFLAGS) &>$(RSPFILE)
        @echo +cmdline +__ntoa +ntoa +__antob +antob &>>$(RSPFILE)
        @echo +strlen +strcmp +stricmp +strcpy +strcat &>>$(RSPFILE)
        @echo +strdup &>>$(RSPFILE)
        @echo +mem.obj>>$(RSPFILE)
        tlib @$(RSPFILE),$(STDLIB32).LST
        @del $(RSPFILE)
        @echo $(STDLIB32).LIB is created. Read $(STDLIB32).LST

clean:
        @if exist test.exe              del test.exe
        @if exist *.obj                 del *.obj
        @if exist *.lst                 del *.lst
        @if exist *.map                 del *.map
        @if exist $(STDLIB32).lib       del $(STDLIB32).lib
        @echo Cleaned

# End of Makefile
